package edu.guet.server.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import edu.guet.server.model.QSSelect;
import edu.guet.server.service.QSSelectService;
import edu.guet.server.utils.ResultAPI;

@RestController
@RequestMapping("/QSSelect")
public class QSSelectController {
    @Autowired
    QSSelectService qsSelectService;

    @RequestMapping("/setQSSelect")
    public ResultAPI setQSSelet(@RequestBody QSSelect qsSelect){
        return qsSelectService.setQSSelect(qsSelect);
    }

    @RequestMapping("/getQSSelect")
    public ResultAPI getQSSelect(@RequestParam Integer tech_id){
        return qsSelectService.getQSSelect(tech_id);
    }

    @RequestMapping("/deleteQSSelect")
    public ResultAPI deleteQSSelect(@RequestParam("qs_id") int qs_id) {
        return qsSelectService.deleteQSSelect(qs_id);
    }

    @RequestMapping("/resetQSSelect")
    public ResultAPI resetQSSelect(@RequestBody QSSelect qsSelect){
        return qsSelectService.resetQSSelect(qsSelect);
    }
}
